package com.yunhai.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunhai.system.domain.WorkJob;
import com.yunhai.system.mapper.WorkJobMapper;
import com.yunhai.system.service.WorkJobService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 招聘信息表服务实现类
 *
 * @author jxj
 * @since 2021-01-10 17:29:46
 */
@Service("workJobService")
public class WorkJobServiceImpl extends ServiceImpl<WorkJobMapper, WorkJob> implements WorkJobService {

    /**
     * 后台查询列表
     *
     * @param workJob
     * @return
     */
    @Override
    public List<WorkJob> queryList(WorkJob workJob) {
        LambdaQueryWrapper<WorkJob> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(workJob.getTitle())){
            lqw.eq(WorkJob::getTitle ,workJob.getTitle());
        }
        lqw.orderByDesc(WorkJob::getCreateTime);
        return this.list(lqw);
    }
}